<?php
session_start();
?>
<html>
<head>


<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<style type="text/css">
<!--
#Layer1 {
	position:absolute;
	left:145px;
	top:8px;
	width:228px;
	height:29px;
	z-index:1;
}
-->
</style>
<script type="text/javascript">
window.onload=function()
{
	document.getElementById('submit').onclick=function(){
		fnc();}
}
var fnc = function()
{
	if(document.getElementById('food').checked)
	{
		$('redemptPoint').value = (document.getElementById('food').point);
		$('redemptItem').value = 'Free Food';
		$('getRedeem').submit();
	}
	else if(document.getElementById('drink').checked)
	{
		$('redemptPoint').value = (document.getElementById('drink').point);
		$('redemptItem').value = 'Free Drink';
		$('getRedeem').submit();
	}
	else if(document.getElementById('discount').checked)
	{
		$('redemptPoint').value = (document.getElementById('discount').point);
		$('redemptItem').value = 'Discount';
		$('getRedeem').submit();
	}
	else
	{
		alert("Please select an item.");
	}
	
};
var $ = function(sId)
{
	return document.getElementById(sId);
}
</script>
</head>

<body bgcolor="#FFFFFF">
<?php      

include("../../MerchandiseBay/conn.php");

  $SQL="select * from users where username='".$_SESSION['username']."'";
  $qry=mysql_query($SQL,$conn);

  while($row=mysql_fetch_array($qry))
	    { 
		  extract($row);  
?>

<div id="Layer1"><strong><font color="#0000FF" size="5">CHECK POINT </font></strong></div>

  <table width="400" height="170" border="0" cellpadding="0" cellspacing="0">
    <tr> 
      <td height="33" colspan="2"><p>&nbsp;</p>
      <p>&nbsp;</p></td>
    </tr>
    <tr> 
      <td width="49%" height="32"><div align="right"><font color="#000000"><strong>Name 
      :</strong></font></div></td>
      <td width="51%"><?php echo $firstname; ?></td>
    </tr>
    <tr> 
      <td height="35"><div align="right"><font color="#000000"><strong>Phone Number :</strong></font></div></td>
      <td><label>
      <?php echo $telno; ?>
      </label></td>
    </tr>
    <tr> 
      <td height="32"><div align="right"><font color="#000000"><strong>Your  Accumulated Points 
          :</strong></font></div></td>
      <td><?php echo $point; ?></td>
    </tr>
    <tr> 
      <td height="24" ><div align="right"> 
          <p><font color="#000000"><strong>Choose Your Redemption  :</strong></font></p>
         
        </div>
        <div align="right">
          <p>&nbsp;</p>
        </div>
        <div align="right">
          <p>&nbsp;</p>
        </div></td>
      <td><p>
        
        <input name="redempt" type="radio" value="free food" id="drink" point="200"> 
        Free Drink
        
      - 200 points </p>
      <p>
        <input name="redempt" type="radio" value="free drink" id="food" point="500"> 
        Free Food - 500 points     </p>
      <p>
        <input name="redempt" type="radio" value="discount" id="discount" point="1000"> 
      Discount 10% - 1000 points </p></td>
    </tr>
	 <tr> 
      <td height="32"></td>
      <td><input type="submit" name="Sub" value="Submit" id="submit"></td>
    </tr>
  </table>
  	<?php
	
}	

	?>
<form name="reservation" method="POST" action="point.php" id="getRedeem">
<input type="hidden" name="name" value="<?  echo $_SESSION['username']; ?>">
<input type="hidden" name="redemptItem" id="redemptItem"/>
<input type="hidden" name="redemptPoint" id="redemptPoint" />
</form>

</body>
</html>
